<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 遍历数组：就是把数组从头到尾访问一次
        var arr=['red','green','blue'];
        for(var i = 0; i < 3; i++) {
            console.log(arr[i]);
        }
        // 1.因为我们的数组索引号从0开始；所以i必须是从0开始 i < 3
        // 2.输出的时候写   arr[i] i  计数器当索引号来用
    </script>
</head>
<body>
    
</body>
</html>